# 导包
import app, unittest, time
from script.test_login import TestLogin
from script.test_approve import TestApprove
from script.test_account import TestAccount
from script.test_invest import TestInvestAPI
from htmltestreport import HTMLTestReport


# 封装测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestLogin))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestApprove))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestAccount))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestInvestAPI))

# 指定报告保存位置
# report_path = app.BASE_DIR + '/report/report{}.html'.format(time.strftime("%Y%m%d_%H%M%S"))
report_path = app.BASE_DIR + '/report/report.html'
# 创建runner
runner = HTMLTestReport(report_path, title='金融接口自动化报告')
# 执行suite
runner.run(suite)













































